package nz.jdbcwrapper;

import java.sql.SQLException;
import java.sql.Blob;
import java.io.InputStream;
import java.io.OutputStream;

class WrapperBlob implements Blob
{
  final Blob blob;

  WrapperBlob(Blob blob)
  {
    this.blob = blob;
  }

  public long length() throws SQLException
  {
    return blob.length();
  }

  public byte[] getBytes(long pos, int length) throws SQLException
  {
    return blob.getBytes(pos, length);
  }

  public InputStream getBinaryStream() throws SQLException
  {
    return blob.getBinaryStream();
  }

  public long position(byte pattern[], long start) throws SQLException
  {
    return blob.position(pattern, start);
  }

  public long position(Blob pattern, long start) throws SQLException
  {
    return blob.position(pattern, start);
  }
  /**
   * @see java.sql.Blob#setBinaryStream(long)
   */
  public OutputStream setBinaryStream(long pos) throws SQLException
  {
    return blob.setBinaryStream(pos);
  }
  /**
   * @see java.sql.Blob#setBytes(long, byte[], int, int)
   */
  public int setBytes(long pos, byte[] bytes, int offset, int len)
    throws SQLException
  {
    return blob.setBytes(pos, bytes, offset, len);
  }
  /**
   * @see java.sql.Blob#setBytes(long, byte[])
   */
  public int setBytes(long pos, byte[] bytes) throws SQLException
  {
    return blob.setBytes(pos, bytes);
  }
  /**
   * @see java.sql.Blob#truncate(long)
   */
  public void truncate(long len) throws SQLException
  {
    blob.truncate(len);
  }

//  public void free() throws SQLException
//  {
//    blob.free();
//  }
//
//  public InputStream getBinaryStream(long pos, long length) throws SQLException
//  {
//    return blob.getBinaryStream(pos, length);
//  }

}
